# 合并元组  通过 +
tup1 = (12,34,87,54)
tup2 = ('one','苹果','香蕉','火龙果')
print(tup1)   # (12, 34, 87, 54)
print(tup2)   # ('one', '苹果', '香蕉', '火龙果')
tup3 = tup1 + tup2
print(tup3)  # (12, 34, 87, 54, 'one', '苹果', '香蕉', '火龙果')

# 重复元组的元素   *
tup4 = (1,2,3)
print(tup4 * 3)  # (1, 2, 3, 1, 2, 3, 1, 2, 3)

# 判断元素是否在元组中  使用成员运算符  in 和 not in
tup5 = (23,4,52,42,True)
print(52 in tup5)  # True
print(99 in tup5)  # False
print(99 not in tup5)  # True

# 元组的切片  元组名[开始下标:结束下标]   截取的范围包含开始下标对应的元素,不包含结束下标对应的元素
tup6 = (35,78,42,457,90)
print(tup6[1:4])  # (78, 42, 457)
print(tup6[1:])   #(78, 42, 457, 90)
print(tup6[:3])   # (35, 78, 42)

